home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9493 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: news.microsoft.com!news
  2. From: dalero@microsoft.com (Dale Rogerson)
  3. Newsgroups: comp.os.ms-windows.programmer.tools.mfc,comp.lang.c++,comp.graphics.api.opengl
  4. Subject: Re: MfcOgl to get multiple OpenGL contexts
  5. Date: 2 Mar 1996 01:25:02 GMT
  6. Organization: Microsoft Corporation
  7. Message-ID: <4h881e$7r9@news.microsoft.com>
  8. References: <3135497E.2AE@alumni.cse.ucsc.edu>
  9. NNTP-Posting-Host: 157.55.73.6
  10. Mime-Version: 1.0
  11. X-Newsreader: WinVN 0.93.14
  12.  
  13. In article <3135497E.2AE@alumni.cse.ucsc.edu>, clp@alumni.cse.ucsc.edu 
  14. says...
  15. >
  16. >I've been using the CMfcOglView class provided with the
  17. >Microsoft MFCOGL with great success.
  18. >
  19. >But now I want to create 2 or 3 OpenGL context regions
  20. >all within the same Window. How would I go about doing this?
  21. >
  22. >This routine goes right into setting up the OpenGL context
  23. >without even giving me a chance to specify/setup other windows:
  24. >
  25. >void CMfcOglView::Init()
  26. >{
  27. >        PIXELFORMATDESCRIPTOR pfd;
  28. >        int         n;
  29. >        HGLRC           hrc;
  30. >    m_pDC = new CClientDC(this);
  31. >    if (!bSetupPixelFormat())
  32. >        return;
  33. >    n = ::GetPixelFormat(m_pDC->GetSafeHdc());
  34. >    ::DescribePixelFormat(m_pDC->GetSafeHdc(), n, sizeof(pfd), &pfd);
  35. >    CreateRGBPalette();
  36. >
  37. >    // create a rendering context and make it current
  38. >    hrc = wglCreateContext(m_pDC->GetSafeHdc());
  39. >    wglMakeCurrent(m_pDC->GetSafeHdc(), hrc);
  40. >
  41. >Any help would be greatly appreciated.
  42. >clp@alumni.cse.ucsc.edu
  43.  
  44. The MSDN article "OpenGL III: Building an OpenGL C++ Class" presents a 
  45. different method for handling multiple OpenGL contexts. 
  46.  
  47. If you don't have a subscription to MSDN, you can view the article at the 
  48. following location:
  49.  
  50.         http://www.microsoft.com/MSDN/LIBRARY/TECHNOTE
  51.  
  52. There are other articles about OpenGL in the same location.
  53.  
  54. The source code was written for Visual C++ version 2.0 and may need to be 
  55. tweaked for Visual C++ version 4.0.
  56.  
  57. Dale Rogerson
  58. Microsoft
  59.  
  60.  
  61. -- 
  62. The opinions expressed in this message are my own personal views 
  63. and do not reflect the official views of Microsoft Corporation.
  64.  
  65.